<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\models\ModuleNavSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Module Navs';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="module-nav-index">

    <h3><?= Html::encode($this->title) ?></h3>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('Create Module Nav', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
//        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'nav_name',
            'nav_order',
            'module_nav_pid',
            'module_id',
            'module_name',
            'uptime',

            [
                'class' => 'yii\grid\ActionColumn',
                'header'=>'操作',
                'template' => '{update} {delete}',
                'buttons' => [
                    'update' => function ($url, $model, $key) {
                        return  Html::a('<span class="glyphicon glyphicon-plus  btn btn-warning btn-sm">更改</span>', $url, ['title' => '更改'] ) ;
                    },
                    'delete' => function ($url, $model, $key) {
                        return  Html::a('<span class="glyphicon glyphicon-plus  btn btn-warning btn-sm">删除</span>', $url, ['title' => '删除'] ) ;
                    },
                ],
                'headerOptions' => ['width' => '180']
            ],
        ],
    ]); ?>

</div>
